package com.ttg.web.dao.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ttg.common.entities.BasePage;
import com.ttg.model.dto.*;

import com.ttg.model.dto.open.TagStatisticsDto;
import com.ttg.model.dto.open.VipTagDto;
import com.ttg.model.mapper.TagHisMapper;
import com.ttg.model.pojo.TagHis;
import com.ttg.model.vo.*;
import com.ttg.model.vo.open.TagStatisticsVo;
import com.ttg.model.vo.open.TagSyncVo;
import com.ttg.model.vo.open.VipTagVo;
import com.ttg.web.dao.TagHisDao;
import org.springframework.stereotype.Service;

@Service
public class TagHisDaoImpl extends ServiceImpl<TagHisMapper, TagHis> implements TagHisDao {

    @Override
    public BasePage<TagHisVo> tagHisPage(TagHisDTO reqDto) {
        return baseMapper.tagHisPage(reqDto.parse(), reqDto);
    }

    @Override
    public BasePage<TagStatisticsVo> getTagStatistics(TagStatisticsDto reqDto) {
        return baseMapper.getTagStatistics(null, reqDto);
    }

    @Override
    public BasePage<VipTagVo> getVipTag(VipTagDto reqDto) {
        return baseMapper.getVipTag(null, reqDto);
    }

    @Override
    public TagSyncVo getSycnTag(Long id) {
        return baseMapper.getSycnTag(id);
    }

    @Override
    public int getEstimate(String sql) {
        if( baseMapper.getEstimate(sql)==null)
        {
            return 0;
        }
        else {
            return baseMapper.getEstimate(sql);
        }

    }


}
